package main

import "fmt"

// type Person struct {
// 	Name string
// 	Age  int
// }
type Cat struct {
	Name  string
	Age   int
	Color string
	Hobby string
}

func main() {
	//使用struct完成案例
	var cat1 Cat //var a int
	cat1.Name = "小白"
	cat1.Age = 3
	cat1.Color = "白色"
	cat1.Hobby = "吃鱼(>^ω^<)喵"
	fmt.Println("cat1=", cat1)
	fmt.Println("cat1名字=", cat1.Name)
	fmt.Println("cat1年龄=", cat1.Age)
	fmt.Println("cat1颜色=", cat1.Color)
	fmt.Println("cat1爱好=", cat1.Hobby)
}
